﻿using Finbook.Entity;
using MassTransit;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Storage.API.Services.EventHandlers
{
    public class OrderCreatedEventHandler
        : IConsumer<OrderCreatedEvent>
    {
        private static int _count = 0;
        public Task Consume(ConsumeContext<OrderCreatedEvent> context)
        {
            Console.WriteLine($"//******{context.Message.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")}:{nameof(OrderCreatedEvent)},{_count++},{context.Message.Id}");
            return Task.CompletedTask;
        }
    }
}
